//
//  SearchViewCell.m
//  project
//
//  Created by lanou on 15/11/4.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "SearchViewCell.h"

@implementation SearchViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
     
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, self.frame.size.width - 20, 30)];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:_titleLabel];
    }
    return self;
}



+(CGFloat)widthForString:(NSString *)string
{
    NSDictionary *dic = [NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:14] forKey:NSFontAttributeName];
    
    CGRect bounds = [string boundingRectWithSize:CGSizeMake(200, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    return bounds.size.width + 20;
}

@end
